<?php


namespace app\admin\model;
use think\Model;

class Sclass extends Model
{
    protected $table='dc_sclass';
    public function getPicAttr($value)
    {
        $status = [10=>'男',20=>'女',30=>'未知'];
        return $status[$value];
    }
    public function getList(){
        return $this->order('orderno asc')->paginate(5);
    }
    /*一级*/
public function getSclass($no){
    return $this->where('pid',$no)->find();
}/*一个*/
public function getSinfo($no){
    return $this->where('id',$no)->find();
}
    public function getupsFoods(){
        return $this->select();
    }
    public function updateSclass($data){
        return $this->isUpdate(true)->save($data);
    }
    public function delSclass($no){
        return $this->where('id',$no)->delete();
    }
}